{include file="public/header"/}
{load href="/public/static/Content/ThemesBusiness/FormPage.css"}

    <style type="text/css">
            *{
                margin: 0;
                padding: 0;
            }
            .tabBox{
                width: 100%;
                height: auto;
                padding: 20px;
                box-sizing: border-box;
            }
            .tabBox .tabUl{
                width: 100%;
                height: auto;
            }
            .tabBox .tabUl>li{
                list-style: none;
            }
            .tabBox .tabUl .tabItem{
                list-style: none;
                width: auto;
                height: 30px;
                line-height: 30px;
                padding: 0 2px 0 7px;
                background-color: #eaf3fe;
                float: left;
                box-sizing: border-box;
                border-radius: 4px;
                margin-right: 10px;
            }
            .tabBox .tabUl .tabItem .text{
                font-size: 15px;
                display: inline-block;
            }
            .tabBox .tabUl .tabItem .close{
                font-size: 17px;
                font-weight: bold;
                display: inline-block;
                color: #73b9ef;
                padding-left: 5px;
                padding-right: 7px;
                cursor: pointer;
            }
        </style>



<div id="tabState" class="easyui-tabs" fit="true">
    <div title="关联序列号">
     
        <form id="formState">
            <table class="form_table" style="width:860px">
                <tr class="form_tr">

                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        商品序列号
                    </th>
                    <td style="width:160px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" readonly="readonly"
                            validtype="workflowStateIsStart"  style="width:150px;" value="{$info.sn}"
                            data-options="required:true,tipPosition:'right'," disabled="disabled" />
                    </td>

                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        关联序列号
                    </th>
                    <td style="width:160px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" validtype="workflowStateIsStart" name="more_sn"
                            style="width:150px;" value="" data-options="required:true,tipPosition:'right'," />
                    </td>
                </tr>

               {notempty name="arr"}
                
             
                <tr class="form_tr">


                    <td style="padding-left:8px;width:80px;border: none" class="form_td form_td_content">
                        关联序列号：
                    </td>
                     <td style="padding-left:8px;border: none" colspan="3" class="form_td form_td_content">
                          <div class="tabBox">
                                <ul class="tabUl">
                                    {foreach name="arr" item="vo" }
                                    <li class="tabItem">

                                        <span class="text">{$vo}</span>
                                        <span class="close" onclick="closex('{$vo}')">×</span>
                                    </li>
                                   {/foreach}
                                    <li style="clear: both;"></li>
                                </ul>
                            </div>  

                     </td>

                  
                </tr>
                {/notempty}
                <!-- 隐藏域 -->
                <input  id="infosn" type="hidden" name="sn" value="{$info.sn}">


                <tr class="form_tr">
                    <td class="form_button_panel" colspan="6" style="padding-right:8px">
                        <!--  <span style="color:red;">数量限制设为0时表示不限制数量</span>  --> <a id="save"
                            class="easyui-linkbutton form-toolbar-button" data-options="iconCls:'icon-save'">保存</a>
                    </td>
                </tr>
                <input type="hidden" name="id" value="{$info.id}">
            </table>
        </form>
    </div>
</div>
<script>
    function closex(delsn){
             var sn= $("#infosn").val();
             //alert(sn);
             //return false;
             $.ajax({
                type: 'POST',
                url: "more_sn_del.html",
                data:{'delsn':delsn,'sn':sn,},
                dataType: "json",
                async: false,
                error: function (request) {
                    alert("发送请求失败！");
                },
                success: function (data) {
                    if (data.status == 1) {
                         window.location.reload();
                        //closeDialog();
                    } else {
                        // $.messager.alert('提示', data.msg, 'info');
                        // return;
                        alert(data.msg);

                    }

                }
            });

        }
    $(function () {
        

        $("#save").on("click", function () {
            $.ajax({
                type: 'POST',
                url: "moresnsave.html",
                data: $("#formState").serialize(),
                dataType: "json",
                async: false,
                error: function (request) {
                    alert("发送请求失败！");
                },
                success: function (data) {
                    if (data.status == 1) {
                        closeRefreshDialog();
                        //closeDialog();
                    } else {
                        // $.messager.alert('提示', data.msg, 'info');
                        // return;
                        alert(data.msg);

                    }

                }
            });
        })
    })


</script>

{include file="public/footer"/}